Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Namespace NVPortal.Modules.NVNews

    Public MustInherit Class Viewer
        Inherits Entities.Modules.PortalModuleBase
#Region "Event Handlers"
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                'If Not IsPostBack Then
                If Request.Item("c") = "" And Request.Item("d") = "" Then
                    'load newstop usercontrol
                    Dim o_control As UserControl
                    o_control = CType(Page.LoadControl("~/DesktopModules/NV_News/Display/Mobile/DetailCat.ascx"), UserControl)
                    Me.plhNews.Controls.Add(o_control)
                End If
                If Request.Item("c") <> "" Then
                    Dim o_control As UserControl
                    o_control = CType(Page.LoadControl("~/DesktopModules/NV_News/Display/Mobile/Detail.ascx"), UserControl)
                    Me.plhNews.Controls.Add(o_control)
                Else
                    If Request.Item("d") <> "" Then
                        Dim o_control As UserControl
                        '' xac dinh lai danhmuc de kiem tra xem co chua thu muc con khong
                        'Dim ctlCategory As New NV_NewsCategoriesController
                        'If ctlCategory.GetByParentId(Request.Item("danhmuc"), PortalId).Count > 0 Then
                        '    o_control = CType(Page.LoadControl("~/DesktopModules/NVNews/Display/News/newstop.ascx"), UserControl)
                        'Else
                        o_control = CType(Page.LoadControl("~/DesktopModules/NV_News/Display/Mobile/DetailCat.ascx"), UserControl)
                        'End If

                        Me.plhNews.Controls.Add(o_control)
                    End If
                End If
            Catch ex As Exception
                ProcessModuleLoadException(Me, ex)
            End Try
        End Sub
#End Region
    End Class

End Namespace
